package Work2;

public class StringHandlerDemo {
    public static void main(String[] args) {
            useStringHandler(new StringHandler() {
                @Override
                public void printMessage(String name) {
                    System.out.println("我叫"+name);
                }
            });

            useStringHandler( name->System.out.println("我叫"+name));
    }
    public static  void useStringHandler(StringHandler s){
        s.printMessage("张雪");
    }
}


interface StringHandler{
    void printMessage(String name);
}
